
const ctrl = {
  state: {
    pos:{x:0, y:0},
    addhover:false, // 音乐新增的时，列表高亮
    menu: {
      hit:false,
      status:false,
      fileid:'',
      artist:'',
      posX:0,
      posY:0,
    },
  },
  getters:{
    getPosX: (state) => {
      return state.pos.x
    },
    getPosY: (state) => {
      return state.pos.y
    },
    getMenuStat: (state) => {
      return state.menu.status
    },
    getMenu: (state) => {
      return state.menu
    },
    add_hover: (state) => {
      return state.addhover
    }
  },
  mutations: {
    setAddHover(state, stat) {
      state.addhover = stat
    },
    setPos: (state, {x, y}) => {
      state.pos.x = x
      state.pos.y = y
    },
    setMenuStat: (state, status) => {
      state.menu.status = status
    },
    setMenuHit: (state, hit) => {
      state.menu.hit = hit
    },
    setMenuStat: (state, eo) => {
      state.menu.hit = eo.hit
      state.menu.status = eo.status
      state.menu.fileid = eo.fileid
      state.menu.artist = eo.artist
      state.menu.posX = eo.x
      state.menu.posY = eo.y
    }
  },
  actions: {

  }
}

export default ctrl